
let common = {
     /**
     * 时间戳转化
     * @param {*} time 时间戳
     */
    timeFormat: function (time) {
        var d = new Date(time),
            month = d.getMonth() + 1,
            day = d.getDate(),
            hours = d.getHours(),
            minute = d.getMinutes(),
            second = d.getSeconds();
        month = month >= 10 ? month : '0' + month;    
        day = day >= 10 ? day : '0' + day;
        hours = hours >= 10 ? hours : '0' + hours;
        minute = minute >= 10 ? minute : '0' + minute;
        second = second >= 10 ? second : '0' + second;
        var sd =
            d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + minute;
        return sd;
    },
    dateTimeClear: function(str) {
        return str.replace(/-|:|\s/g, '');
    }
}
export default common;